/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aptech.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Winner
 */
@Entity
@Table(name = "tblWorking")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TblWorking.findAll", query = "SELECT t FROM TblWorking t"),
    @NamedQuery(name = "TblWorking.findByWkID", query = "SELECT t FROM TblWorking t WHERE t.wkID = :wkID"),
    @NamedQuery(name = "TblWorking.findByWkName", query = "SELECT t FROM TblWorking t WHERE t.wkName = :wkName")})
public class TblWorking implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "wkID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer wkID;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "wkName")
    private String wkName;
    @OneToMany(mappedBy = "wkID")
    private List<TblProjectDetail> tblProjectDetailList;

    public TblWorking() {
    }

    public TblWorking(Integer wkID) {
        this.wkID = wkID;
    }

    public TblWorking(Integer wkID, String wkName) {
        this.wkID = wkID;
        this.wkName = wkName;
    }

    public Integer getWkID() {
        return wkID;
    }

    public void setWkID(Integer wkID) {
        this.wkID = wkID;
    }

    public String getWkName() {
        return wkName;
    }

    public void setWkName(String wkName) {
        this.wkName = wkName;
    }

    @XmlTransient
    public List<TblProjectDetail> getTblProjectDetailList() {
        return tblProjectDetailList;
    }

    public void setTblProjectDetailList(List<TblProjectDetail> tblProjectDetailList) {
        this.tblProjectDetailList = tblProjectDetailList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (wkID != null ? wkID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TblWorking)) {
            return false;
        }
        TblWorking other = (TblWorking) object;
        if ((this.wkID == null && other.wkID != null) || (this.wkID != null && !this.wkID.equals(other.wkID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
      //  return "com.aptech.entities.TblWorking[ wkID=" + wkID + " ]";
        return this.getWkName();
    }
}
